<?
  class Alert_View
  {
    private static $_MSG_LIST = array();

	const WARNING = E_WARNING;
	const NOTICE = E_NOTICE;

    public static function getMessages()
	{
	  return self::$_MSG_LIST;
	}

	public static function zendErrorForm(Zend_Form $form, $title)
	{
	  $msg = "";
	  foreach ($form->getMessages() as $key => $list)
	  {
	    $msg .= "<label>".$form->getElement($key)->getLabel(). "</label>";
		foreach ($list as $err)
	      $msg .= "<div>- ".$err. "</div>";
	  }
      self::addMessage(Alert_View::WARNING, $title, $msg);
	}

    public static function addMessage($msg_type = Alert_View::NOTICE, $title, $text)
	{
	  self::$_MSG_LIST[] = array('type' => $msg_type, 'title' => $title, 'text' => $text);
	}
  }
